package com.ipartek.pruebas.bbddaccessP8;

import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.SQLException;

public class MYSQLDAOFactoryP8 extends DAOFactoryP8{

	static final String DRIVER  = "com.mysql.jdbc.Driver";
	static final String CON_URL = "jdbc:mysql://localhost/prueba";
	static final String USER    = "root";
	static final String PASS    = "admin";
	
	public MYSQLDAOFactoryP8(){
		try{
		Class.forName( DRIVER );
		}catch (ClassNotFoundException e) {
			e.printStackTrace();
		}
	}
	
	public static Connection getConnection(){
		Connection con = null;
		try{
			con = DriverManager.getConnection( CON_URL, USER , PASS);
		}catch(SQLException e){
			e.printStackTrace();
		}
		return con;
	}
	
	@Override
	public AlumnoDAOP8 getAlumno() {
		return new AlumnoMYSQLDAOP8();
	}

	@Override
	public CursoDAOP8 getCurso() {
		// TODO Auto-generated method stub
		return null;
	}

}
